<?php
namespace app\common\validate;

use think\Validate;

class Order extends Validate
{
    protected $rule = [
        'money'         =>  'isMoney',
        'alipay_sn'     =>  'require|max:100',
    ];
    protected $message = [
        'money.isMoney'         =>  '充值金额输入有误',
        'alipay_sn.require'     =>  '支付宝订单编号不能为空 ',
        'alipay_sn.max'         =>  '支付宝订单编号输入有误',
    ];

    public function isMoney($value)
    {
        return ceil($value*100) == $value*100 ? true : false;
    }

}